package com.time.sky.controller;

import com.time.sky.entity.Uinfo;
import com.time.sky.mapper.UinfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RestController
@CrossOrigin
@RequestMapping("/Uinfo")
public class UinfoController {
    @Autowired
    private UinfoMapper uinfoMapper;
    @ResponseBody
    @RequestMapping("/select")
    public List<Uinfo> selectList(){   return uinfoMapper.selectList(); }
    @RequestMapping("/add")
    public void add(Uinfo uinfo){
        uinfoMapper.add(uinfo);
    }
    @RequestMapping("/delete/{uid}")
    public void delete(@PathVariable("uid") int uid){
        uinfoMapper.delete(uid);
    }
    @RequestMapping("/get/{uid}")
    public Uinfo getById(@PathVariable("uid") int uid){ return uinfoMapper.getById(uid); }
    @RequestMapping("/update")
    public void update(Uinfo uinfo){
        uinfoMapper.update(uinfo);
    }
    @ResponseBody
    @RequestMapping("/rows")
    public int rows(){
        return uinfoMapper.getRowCount();
    }
}
